package com.example.x3day04.base;

import android.app.Application;
import android.content.Context;
import android.content.res.Resources;

import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig;

public class BaseApp extends Application {
    public static Context context;

    public static Resources getRes() {
        return context.getResources();
    }
    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        //初始化友盟
        initUmeng();


    }

    private void initUmeng() {
        //设置允许打印日志
        UMConfigure.setLogEnabled(true);
        //第一个：上下文；
        // 第二个：友盟的AppKey；
        // 第三个：渠道号
        //第四个：设备类型
        //第五个：推送的AppKey
        UMConfigure.init(this,"5a12384aa40fa3551f0001d1"
                ,"umeng",UMConfigure.DEVICE_TYPE_PHONE,"");//58edcfeb310c93091c000be2 5965ee00734be40b580001a0

        //接下来需要设置各个平台的appkey：
        PlatformConfig.setWeixin("wxdc1e388c3822c80b", "3baf1193c85774b3fd9d18447d76cab0");
        //豆瓣RENREN平台目前只能在服务器端配置
        PlatformConfig.setSinaWeibo("3921700954", "04b48b094faeb16683c32669824ebdad","http://sns.whalecloud.com");
        PlatformConfig.setQQZone("100424468", "c7394704798a158208a74ab60104f0ba");

    }
}
